import Https from '@/utils/https'

// 接口测试
const queryTestReq = (params) => Https.post('/api/v1/integration/api/http/test', params, { needCode: true })

// 预览
const queryPreviewReq = (params) => Https.post('/api/v1/integration/api/http/preview', params, { needCode: true })

// 获取数据目标
const queryGetDatabasesReq = (params) => Https.get('/api/v1/integration/api/http/getDatabases', params)

// 获取目标表
const queryGetTargetTablesReq = (params) => Https.get('/api/v1/integration/api/http/getTargetTables', params)

// 获取一键建表语句
const queryGetCreateTableDDLReq = (params) => Https.post('/api/v1/integration/api/http/getCreateTableDDL', params)

// 一键建表
const querySaveTargetTableReq = (params) => Https.post('/api/v1/integration/api/http/saveTargetTable', params, { needCode: true })

// 字段映射
const queryGetTagetTableFieldsReq = (params) => Https.get('/api/v1/integration/api/http/getTagetTableFields', params)

// 新建-保存编辑任务
const querySaveTaskReq = (params) => Https.post('/api/v1/integration/api/http/saveTask', params, { needCode: true })

// 查看任务
const queryGetTaskByIdReq = (params) => Https.get('/api/v1/integration/api/http/getTaskById', params)
export {
  queryTestReq, queryPreviewReq, queryGetDatabasesReq, queryGetTargetTablesReq, queryGetCreateTableDDLReq, querySaveTargetTableReq, queryGetTagetTableFieldsReq, querySaveTaskReq, queryGetTaskByIdReq,
}
